package com.sq.partner.manager.dao;

import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Repository;

import com.sq.partner.manager.common.exception.AppException;
import com.sq.partner.manager.mybatis.model.FacadeUser;
import com.sq.partner.manager.mybatis.model.GatewayRole;
import com.sq.partner.manager.mybatis.model.GatewayTrans;
import com.sq.partner.manager.mybatis.model.GatewayUser;
import com.sq.partner.manager.mybatis.model.GatewayUserRole;
import com.sq.partner.manager.mybatis.model.TradAgentInfo;
import com.sq.partner.manager.util.Page;

/**
 * 出单用户维护
 * @author Zhao Zhihui
 *
 */
public interface IFacadeUserDao{


	/**
	 * 分页查询所有用户
	 * @param page
	 * @param pageIndex
	 * @param user
	 * @return
	 * @throws Exception
	 */
	public Page queryPage(Page page,Integer pageIndex, FacadeUser user) throws Exception;
	

	/**
	 * 新增用户
	 * @param user
	 * @return
	 * @throws Exception
	 */
	boolean addUser(FacadeUser user) throws Exception;

	
	/**
	 * 根据某个条件查询返回结果的数据条数
	 * @param user
	 * @return
	 * @throws Exception
	 */
	FacadeUser queryUserCountByMap(Map<String,String> map) throws Exception;

	
	/**
	 * 修改用户信息
	 * @param user
	 * @return
	 * @throws Exception
	 */
	boolean saveUser(FacadeUser user) throws Exception;

	
	/**
	 * 根据用户ID查询用户信息
	 * @param userid
	 * @return
	 * @throws Exception
	 */
	FacadeUser queryUserById(Long userid) throws Exception;

	
	/**
	 * 根据用户id删除
	 * @param userid
	 * @throws Exception
	 */
	boolean delUserById(Long userid) throws Exception;

	boolean updateUser(FacadeUser user) throws Exception;
	boolean delUserByUserCodeAndUserType(String userCode, String userType) throws Exception;
	boolean delUserBySubChannelCodeAndUserType(String subChannelCode, String userType) throws Exception;
	public void addBatchMtFacadeUserInfo(List<FacadeUser> list) throws AppException;


	List<FacadeUser> queryUsersByMapUser(FacadeUser user) throws Exception;


	List<FacadeUser> queryUsersByUserCodeStr(String UserCodeStr) throws Exception;

}
